<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { goodsOutDetailApi } from '@/apis/goods.js'

const formData = ref({
  batch: "",
  batchno: "",
  goodscode: "",
  goodsmodel: "",
  goodsname: "",
  memo: "",
  outnum: "",
  unit: "",
  unitweight: "",
  weight: "",
})
// 是否新品单选框
const ifnewList = ref([
  { name: '是', value: 'Y' },
  { name: '否', value: 'N' }
])

onLoad(async options => {
  if (options?.id) {
    const res = await goodsOutDetailApi(options.id)
    formData.value = { ...res.data }
  }
})

const confing = {
  api: '/logistics/outorderdetail',
  requiredFields: [{
    key: 'goodscode',
    name: '物料编码',
  }, {
    key: 'goodsname',
    name: '物料名称',
  },
  ]
}
</script>

<template>
  <view class="carinfo page_container">
    <view class="content">
      <u-form :model="formData" label-width="150">
        <u-form-item label="物料编码:" required>
          <u-input disabled v-model="formData.goodscode" placeholder="请输入物料编码" />
        </u-form-item>
        <u-form-item label="物料名称:" required>
          <u-input disabled v-model="formData.goodsname" type="textarea" placeholder="请输入物料名称" />
        </u-form-item>
        <u-form-item label="规格:">
          <u-input disabled v-model="formData.goodsmodel" placeholder="请输入规格" />
        </u-form-item>
        <u-form-item label="批次:">
          <u-input disabled v-model="formData.batch" placeholder="请输入批次" />
        </u-form-item>
        <u-form-item label="批次号:">
          <u-input disabled v-model="formData.batchno" placeholder="请输入批次号" />
        </u-form-item>
        <u-form-item label="单位:">
          <u-input disabled v-model="formData.unit" placeholder="请输入单位" />
        </u-form-item>
        <u-form-item label="单位重量:">
          <u-input disabled v-model="formData.unitweight" placeholder="请输入单位重量" />
        </u-form-item>
        <u-form-item label="数量:">
          <u-input disabled v-model="formData.outnum" placeholder="请输入毛重" />
        </u-form-item>
        <u-form-item label="重量:">
          <u-input disabled v-model="formData.weight" placeholder="请输入毛重" />
        </u-form-item>
        <u-form-item label="备注:">
          <u-input disabled v-model="formData.memo" type="textarea" placeholder="请输入备注" />
        </u-form-item>
      </u-form>
    </view>
  </view>
</template>

<style lang="scss" scoped>
.carinfo {
  min-height: 100vh;
  background: #f5f5f5;
  padding-top: 20rpx;
  padding-bottom: 30rpx;

  .content {
    background: #fff !important;
    border-radius: 20rpx;
    padding: 0 40rpx;
    margin-bottom: 20rpx;
  }
}

::v-deep .uicon-plus {
  margin-top: 4rpx;
}

.more_list {
  width: 170rpx;
  padding-top: 30rpx;

  view {
    padding-bottom: 30rpx;
  }
}
</style>